<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <title>操作日志 - 社交平台</title>
  <!-- Bootstrap 5 CSS -->
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
  
  <style>
    /* 基础样式 */
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      background-color: #f5f7fa;
      color: #333;
      min-height: 100vh;
      margin: 0;
    }
    
    /* 顶部导航 */
    .top-nav {
      height: 50px;
      background-color: #fff;
      border-bottom: 1px solid #eee;
      display: flex;
      align-items: center;
      padding: 0 15px;
      position: sticky;
      top: 0;
      z-index: 100;
    }
    
    .nav-title {
      font-size: 18px;
      font-weight: 600;
      margin: 0 auto;
    }
    
    .nav-btn {
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #666;
      text-decoration: none;
    }
    
    .nav-btn.primary {
      color: #2196f3;
    }
    
    /* 样式切换器 */
    .style-switcher {
      background-color: #fff;
      padding: 12px 15px;
      border-bottom: 1px solid #eee;
    }
    
    .style-tabs {
      display: flex;
      gap: 8px;
      overflow-x: auto;
      padding-bottom: 5px;
    }
    
    .style-tabs::-webkit-scrollbar {
      display: none;
    }
    
    .style-tab {
      padding: 6px 14px;
      background-color: #f5f7fa;
      border-radius: 20px;
      font-size: 14px;
      white-space: nowrap;
      cursor: pointer;
    }
    
    .style-tab.active {
      background-color: #2196f3;
      color: white;
    }
    
    /* 通用日志页面通用样式 */
    .log-page {
      display: none;
      min-height: calc(100vh - 101px);
    }
    
    .log-page.active {
      display: block;
    }
    
    /* 筛选栏 */
    .filter-bar {
      padding: 12px 15px;
      background-color: #fff;
      border-bottom: 1px solid #eee;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    
    .filter-title {
      font-size: 14px;
      color: #666;
    }
    
    .filter-options {
      display: flex;
      gap: 10px;
    }
    
    .filter-option {
      font-size: 14px;
      color: #2196f3;
    }
    
    /* 日志列表项基础样式 */
    .log-item {
      padding: 15px;
      background-color: #fff;
      border-bottom: 1px solid #f5f7fa;
    }
    
    .log-header {
      display: flex;
      justify-content: space-between;
      margin-bottom: 5px;
    }
    
    .log-action {
      font-weight: 500;
      font-size: 15px;
    }
    
    .log-time {
      font-size: 12px;
      color: #999;
    }
    
    .log-details {
      font-size: 14px;
      color: #666;
      line-height: 1.4;
    }
    
    /* 状态标签 */
    .status-tag {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 4px;
      font-size: 12px;
      margin-left: 5px;
    }
    
    .status-success {
      background-color: #e8f5e9;
      color: #4caf50;
    }
    
    .status-warning {
      background-color: #fff8e1;
      color: #ff9800;
    }
    
    .status-error {
      background-color: #ffebee;
      color: #f44336;
    }
    
    /* 空类型图标样式1 - 标准列表式列表 */
    .detailed-logs .log-item {
      position: relative;
      padding-left: 40px;
    }
    
    .detailed-logs .log-icon {
      position: absolute;
      left: 15px;
      top: 18px;
      width: 24px;
      height: 24px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
    }
    
    .icon-login {
      background-color: #e3f2fd;
      color: #2196f3;
    }
    
    .icon-profile {
      background-color: #e8f5e9;
      color: #4caf50;
    }
    
    .icon-security {
      background-color: #fff8e1;
      color: #ff9800;
    }
    
    .icon-content {
      background-color: #f3e5f5;
      color: #9c27b0;
    }
    
    .detailed-logs .log-details {
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px dashed #eee;
    }
    
    /* 日志样式2 - 紧凑式卡片 */
    .card-logs {
      padding: 10px;
    }
    
    .card-logs .log-item {
      border-radius: 10px;
      margin-bottom: 10px;
      box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    }
    
    .card-logs .log-meta {
      display: flex;
      justify-content: space-between;
      margin-top: 8px;
      font-size: 12px;
      color: #999;
    }
    
    .log-ip {
      display: flex;
      align-items: center;
    }
    
    .log-ip i {
      margin-right: 4px;
      font-size: 10px;
    }
    
    /* 日志样式3 - 紧凑约列表 */
    .simple-logs .log-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    
    .simple-logs .log-info {
      display: flex;
      align-items: center;
    }
    
    .simple-logs .log-icon {
      width: 20px;
      height: 20px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      margin-right: 10px;
    }
    
    .simple-logs .log-action {
      font-size: 14px;
    }
    
    /* 日志样式4 - 分组类分组 */
    .grouped-logs .log-date-group {
      padding: 15px 15px 5px;
      font-size: 13px;
      color: #999;
      font-weight: 500;
    }
    
    .grouped-logs .log-group-content {
      padding-left: 15px;
      padding-right: 15px;
    }
    
    .grouped-logs .log-item {
      border-bottom: 1px solid #eee;
      margin-bottom: 5px;
    }
    
    .grouped-logs .log-header {
      align-items: center;
    }
    
    .grouped-logs .log-category {
      font-size: 12px;
      padding: 2px 6px;
      border-radius: 4px;
      background-color: #f0f7ff;
      color: #2196f3;
      margin-right: 8px;
    }
    
    /* 空状态 */
    .empty-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 60px 20px;
      color: #999;
      text-align: center;
    }
    
    .empty-icon {
      font-size: 60px;
      margin-bottom: 20px;
      opacity: 0.3;
    }
    
    .empty-text {
      font-size: 16px;
      margin-bottom: 10px;
    }
    
    /* 提示框框 */
    .toast {
      position: fixed;
      bottom: 80px;
      left: 50%;
      transform: translateX(-50%);
      background-color: rgba(0,0,0,0.8);
      color: white;
      border-radius: 8px;
      padding: 10px 15px;
      font-size: 14px;
      z-index: 1000;
      display: none;
    }
  </style>
</head>
<body>
  <!-- 提示框 -->
  <div class="toast" id="toast"></div>
  
  <!-- 顶部导航 -->
  <nav class="top-nav">
    <a href="#" class="nav-btn" id="backBtn">
      <i class="fa fa-angle-left"></i>
    </a>
    <h1 class="nav-title">操作日志</h1>
    <a href="#" class="nav-btn primary" id="refreshBtn">
      <i class="fa fa-refresh"></i>
    </a>
  </nav>
  
  <!-- 样式切换器 -->
  <div class="style-switcher">
    <div class="style-tabs">
      <div class="style-tab active" data-style="detailed">详细列表</div>
      <div class="style-tab" data-style="card">卡片式</div>
      <div class="style-tab" data-style="simple">简约列表</div>
      <div class="style-tab" data-style="grouped">分类分组</div>
    </div>
  </div>
  
  <!-- 样式1 - 详细列表 -->
  <div class="log-page active detailed-logs" id="detailed">
    <div class="filter-bar">
      <div class="filter-title">最近30天操作</div>
      <div class="filter-options">
        <div class="filter-option" onclick="showToast('已切换至全部类型')">全部</div>
        <div class="filter-option" onclick="showToast('已切换至安全相关')">安全</div>
      </div>
    </div>
    
    <div class="log-item">
      <div class="log-icon icon-login">
        <i class="fa fa-sign-in"></i>
      </div>
      <div class="log-header">
        <div class="log-action">账户登录 <span class="status-tag status-success">成功</span></div>
        <div class="log-time">今天 08:45</div>
      </div>
      <div class="log-details">
        登录方式：密码登录<br>
        设备：iPhone 13 (iOS 16.3.1)<br>
        IP地址：113.XXX.XXX.45
      </div>
    </div>
    
    <div class="log-item">
      <div class="log-icon icon-profile">
        <i class="fa fa-user"></i>
      </div>
      <div class="log-header">
        <div class="log-action">修改个人资料</div>
        <div class="log-time">昨天 16:20</div>
      </div>
      <div class="log-details">
        修改内容：昵称、头像<br>
        设备：Chrome浏览器 (Windows 10)<br>
        IP地址：113.XXX.XXX.45
      </div>
    </div>
    
    <div class="log-item">
      <div class="log-icon icon-content">
        <i class="fa fa-image"></i>
      </div>
      <div class="log-header">
        <div class="log-action">发布动态</div>
        <div class="log-time">昨天 10:15</div>
      </div>
      <div class="log-details">
        内容类型：图片+文字<br>
        可见范围：公开<br>
        设备：Safari浏览器 (macOS Monterey)
      </div>
    </div>
    
    <div class="log-item">
      <div class="log-icon icon-security">
        <i class="fa fa-lock"></i>
      </div>
      <div class="log-header">
        <div class="log-action">修改密码 <span class="status-tag status-success">成功</span></div>
        <div class="log-time">06-12 21:30</div>
      </div>
      <div class="log-details">
        验证方式：短信验证码<br>
        设备：微信浏览器 (Android 12)<br>
        IP地址：180.XXX.XXX.123
      </div>
    </div>
    
    <div class="log-item">
      <div class="log-icon icon-security">
        <i class="fa fa-lock"></i>
      </div>
      <div class="log-header">
        <div class="log-action">登录尝试 <span class="status-tag status-error">失败</span></div>
        <div class="log-time">06-12 09:12</div>
      </div>
      <div class="log-details">
        失败原因：密码错误（3次）<br>
        设备：未知设备 (Linux)<br>
        IP地址：221.XXX.XXX.78<br>
        位置：北京市 联通
      </div>
    </div>
  </div>
  
  <!-- 样式2 - 卡片式 -->
  <div class="log-page card-logs" id="card">
    <div class="filter-bar">
      <div class="filter-title">操作记录</div>
      <div class="filter-options">
        <div class="filter-option" onclick="showToast('已筛选：今天')">今天</div>
      </div>
    </div>
    
    <div class="log-item">
      <div class="log-header">
        <div class="log-action">账户登录 <span class="status-tag status-success">成功</span></div>
        <div class="log-time">08:45</div>
      </div>
      <div class="log-details">
        登录方式：密码登录，设备：iPhone 13
      </div>
      <div class="log-meta">
        <div class="log-ip"><i class="fa fa-map-marker"></i> 本地网络</div>
        <div>安全验证：通过</div>
      </div>
    </div>
    
    <div class="log-item">
      <div class="log-header">
        <div class="log-action">修改个人资料</div>
        <div class="log-time">昨天 16:20</div>
      </div>
      <div class="log-details">
        修改内容：昵称、头像
      </div>
      <div class="log-meta">
        <div class="log-ip"><i class="fa fa-map-marker"></i> 本地网络</div>
        <div>Chrome浏览器</div>
      </div>
    </div>
    
    <div class="log-item">
      <div class="log-header">
        <div class="log-action">发布动态</div>
        <div class="log-time">昨天 10:15</div>
      </div>
      <div class="log-details">
        内容类型：图片+文字，可见范围：公开
      </div>
      <div class="log-meta">
        <div class="log-ip"><i class="fa fa-map-marker"></i> 本地网络</div>
        <div>Safari浏览器</div>
      </div>
    </div>
    
    <div class="log-item">
      <div class="log-header">
        <div class="log-action">修改密码 <span class="status-tag status-success">成功</span></div>
        <div class="log-time">06-12 21:30</div>
      </div>
      <div class="log-details">
        验证方式：短信验证码
      </div>
      <div class="log-meta">
        <div class="log-ip"><i class="fa fa-map-marker"></i> 北京市 联通</div>
        <div>微信浏览器</div>
      </div>
    </div>
    
    <div class="log-item">
      <div class="log-header">
        <div class="log-action">登录尝试 <span class="status-tag status-error">失败</span></div>
        <div class="log-time">06-12 09:12</div>
      </div>
      <div class="log-details">
        失败原因：密码错误（3次）
      </div>
      <div class="log-meta">
        <div class="log-ip"><i class="fa fa-map-marker"></i> 北京市 联通</div>
        <div>未知设备</div>
      </div>
    </div>
  </div>
  
  <!-- 样式3 - 简约列表 -->
  <div class="log-page simple-logs" id="simple">
    <div class="filter-bar">
      <div class="filter-title">操作日志</div>
      <div class="filter-option" onclick="showToast('已刷新日志列表')">
        <i class="fa fa-refresh"></i>
      </div>
    </div>
    
    <div class="log-item">
      <div class="log-info">
        <div class="log-icon icon-login">
          <i class="fa fa-sign-in"></i>
        </div>
        <div class="log-action">账户登录</div>
      </div>
      <div class="log-time">今天 08:45</div>
    </div>
    
    <div class="log-item">
      <div class="log-info">
        <div class="log-icon icon-profile">
          <i class="fa fa-user"></i>
        </div>
        <div class="log-action">修改个人资料</div>
      </div>
      <div class="log-time">昨天 16:20</div>
    </div>
    
    <div class="log-item">
      <div class="log-info">
        <div class="log-icon icon-content">
          <i class="fa fa-image"></i>
        </div>
        <div class="log-action">发布动态</div>
      </div>
      <div class="log-time">昨天 10:15</div>
    </div>
    
    <div class="log-item">
      <div class="log-info">
        <div class="log-icon icon-security">
          <i class="fa fa-lock"></i>
        </div>
        <div class="log-action">修改密码</div>
      </div>
      <div class="log-time">06-12 21:30</div>
    </div>
    
    <div class="log-item">
      <div class="log-info">
        <div class="log-icon icon-security">
          <i class="fa fa-exclamation-triangle"></i>
        </div>
        <div class="log-action">登录尝试失败</div>
      </div>
      <div class="log-time">06-12 09:12</div>
    </div>
    
    <div class="log-item">
      <div class="log-info">
        <div class="log-icon icon-content">
          <i class="fa fa-comment"></i>
        </div>
        <div class="log-action">评论了帖子</div>
      </div>
      <div class="log-time">06-11 15:40</div>
    </div>
    
    <div class="log-item">
      <div class="log-info">
        <div class="log-icon icon-content">
          <i class="fa fa-bookmark"></i>
        </div>
        <div class="log-action">收藏了内容</div>
      </div>
      <div class="log-time">06-11 14:25</div>
    </div>
  </div>
  
  <!-- 样式4 - 分类分组 -->
  <div class="log-page grouped-logs" id="grouped">
    <div class="filter-bar">
      <div class="filter-title">操作记录</div>
      <div class="filter-options">
        <div class="filter-option" onclick="showToast('已按日期排序')">按日期</div>
      </div>
    </div>
    
    <div class="log-date-group">今天</div>
    <div class="log-group-content">
      <div class="log-item">
        <div class="log-header">
          <span class="log-category">账户</span>
          <div class="log-action">账户登录 <span class="status-tag status-success">成功</span></div>
          <div class="log-time">08:45</div>
        </div>
        <div class="log-details">
          登录方式：密码登录，设备：iPhone 13
        </div>
      </div>
    </div>
    
    <div class="log-date-group">昨天</div>
    <div class="log-group-content">
      <div class="log-item">
        <div class="log-header">
          <span class="log-category">个人资料</span>
          <div class="log-action">修改个人资料</div>
          <div class="log-time">16:20</div>
        </div>
        <div class="log-details">
          修改内容：昵称、头像
        </div>
      </div>
      
      <div class="log-item">
        <div class="log-header">
          <span class="log-category">内容</span>
          <div class="log-action">发布动态</div>
          <div class="log-time">10:15</div>
        </div>
        <div class="log-details">
          内容类型：图片+文字，可见范围：公开
        </div>
      </div>
    </div>
    
    <div class="log-date-group">06月12日</div>
    <div class="log-group-content">
      <div class="log-item">
        <div class="log-header">
          <span class="log-category">安全</span>
          <div class="log-action">修改密码 <span class="status-tag status-success">成功</span></div>
          <div class="log-time">21:30</div>
        </div>
        <div class="log-details">
          验证方式：短信验证码
        </div>
      </div>
      
      <div class="log-item">
        <div class="log-header">
          <span class="log-category">安全</span>
          <div class="log-action">登录尝试 <span class="status-tag status-error">失败</span></div>
          <div class="log-time">09:12</div>
        </div>
        <div class="log-details">
          失败原因：密码错误（3次），位置：北京市 联通
        </div>
      </div>
    </div>
    
    <div class="log-date-group">06月11日</div>
    <div class="log-group-content">
      <div class="log-item">
        <div class="log-header">
          <span class="log-category">内容</span>
          <div class="log-action">评论了帖子</div>
          <div class="log-time">15:40</div>
        </div>
      </div>
      
      <div class="log-item">
        <div class="log-header">
          <span class="log-category">内容</span>
          <div class="log-action">收藏了内容</div>
          <div class="log-time">14:25</div>
        </div>
      </div>
    </div>
  </div>
  
  <!-- Bootstrap JS -->
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
  
  <script>
    // 获取元素
    const styleTabs = document.querySelectorAll('.style-tab');
    const logPages = document.querySelectorAll('.log-page');
    const backBtn = document.getElementById('backBtn');
    const refreshBtn = document.getElementById('refreshBtn');
    const toast = document.getElementById('toast');
    
    // 样式切换
    styleTabs.forEach(tab => {
      tab.addEventListener('click', function() {
        // 移除所有激活状态
        styleTabs.forEach(t => t.classList.remove('active'));
        logPages.forEach(page => page.classList.remove('active'));
        
        // 设置当前激活状态
        this.classList.add('active');
        const style = this.getAttribute('data-style');
        document.getElementById(style).classList.add('active');
        
        showToast(`已切换到${this.textContent}`);
      });
    });
    
    // 返回按钮
    backBtn.addEventListener('click', function() {
      showToast('返回上一页');
    });
    
    // 刷新按钮
    refreshBtn.addEventListener('click', function() {
      showToast('日志已刷新');
    });
    
    // 显示提示
    function showToast(message) {
      toast.textContent = message;
      toast.style.display = 'block';
      
      setTimeout(() => {
        toast.style.opacity = '0';
        setTimeout(() => {
          toast.style.display = 'none';
          toast.style.opacity = '1';
        }, 300);
      }, 2000);
    }
  </script>
</body>
</html>
